package com.yhj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yhj.mapper.ProductMapper;
import com.yhj.mapper.ProductPlusMapper;
import com.yhj.model.Product;
import com.yhj.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yaohj
 * @date 2024年11月20日 13:43
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductPlusMapper, Product> implements ProductService {
    @Autowired
    private ProductMapper productMapper;
    @Autowired
    private ProductPlusMapper productPlusMapper;

    @Override
    public Product getProductById(Integer id) {
        return productMapper.getById(id);
    }

    @Override
    public Product getProductPlusById(Integer id) {
      //  productPlusMapper.selectById(id);
        return productPlusMapper.getById(id);
    }

    @Override
    public int insertProduct(Product product) {
        return productPlusMapper.insert(product);
    }
}
